package user_assets_ewallet

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/assets-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/assets-api/internal/types"
	"gitee.com/liuxuezhan/ar-platform/assets-api/pkg/emun"
	"github.com/zeromicro/go-zero/core/logx"
)

type UserEWalletTypeLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// 电子钱包类型
func NewUserEWalletTypeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserEWalletTypeLogic {
	return &UserEWalletTypeLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *UserEWalletTypeLogic) UserEWalletType() (resp *types.UserEwalletTypeResponse, err error) {
	var enumData []types.Emun
	for key, value := range emun.UserEWalletTypeMap {
		enumData = append(enumData, types.Emun{
			Key:   int32(key),
			Value: value,
		})
	}

	return &types.UserEwalletTypeResponse{
		EmunData: enumData,
	}, nil

	return

}
